// pages/order/order.js
var config = require("../../utils/config.js");
var network = require("../../utils/network.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currentTab:'',
    openid:'',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      currentTab:options.currentTab,
      openid:wx.getStorageSync("userInfo").openid
    })
    this.selectComponent("#all").getOrderData() //获取全部数据
    this.selectComponent("#wait").getOrderData() //待付款数据
    this.selectComponent("#pay").getOrderData() //已付款
    this.selectComponent("#server").getOrderData() //服务中
    this.selectComponent("#finish").getOrderData() //已完成
    this.selectComponent("#appraise").getOrderData() //待评价
  },

  clickTab: function (e) {
    var that = this;
    if (this.data.currentTab === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentTab: e.target.dataset.current,
      })
    }
  },
  backList:function(){
    this.selectComponent("#all").getOrderData() //获取全部数据
    this.selectComponent("#wait").getOrderData() //待付款数据
    this.selectComponent("#pay").getOrderData() //已付款
    this.selectComponent("#appraise").getOrderData() //待评价
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})